Object.prototype.sex ='男'
let obj={
     name:'zs',
     age:18,
     hobby:{
         a:'唱',
         b:'跳',
         c:'rap'
     }
}

function shallowCopy(obj){
    let newObj ={}
    for(let key in obj){
         if(obj.hasOwnProperty(key)){//判断 key 是不是obj显示拥有的
          newObj[key]=obj[key]
         }
    }

    return newObj
}
console.log(shallowCopy(obj));
